#ifndef __DPS_API_H__
#define __DPS_API_H__
#include "dps_param.h"
#include "dps_struct.h"
#include "dps_addrdef.h"
#include "sidcOption.h"
#include "os_msg.h"
#include "sidcInit.h"
//#define G_DPS_USB_SPEED_HIGH	1

#define DPS_API_ENABLE 1
#define DPS_CMD_ENABLE 1



#if !G_DPS_OPTION_OPEN
#undef DPS_API_ENABLE
#undef DPS_CMD_ENABLE
#define DPS_API_ENABLE 0
#define DPS_CMD_ENABLE 0
#endif

#define DPS_PRINT_1_ENABLE	0
#define DPS_PRINT_2_ENABLE 0	//important print
#define DPS_PRINT_3_ENABLE 0 //function name

#define DPS_PRINT_4_ENABLE 0//err info

#define DPS_PRINT_CMD_ENABLE 1
//////////////////////////////////
/////////////////////////////////
//extern UINT8 g_dpsLastNotResponseAction ;
//"dps_action.h"

#define DPS_ACTION_MASK	0xf0
#define DPS_ACTION_MASK_	0X0F

#define DPS_ACTION_Idle	0x00

#define DPS_ACTION_Err	0x70
#define DPS_ACTION_Err_XMLStruct	0x71	//xml structure err
#define DPS_ACTION_Err_Result		0x72	//response the value of result is not OK(0x10000000)
#define DPS_ACTION_Err_Notify	0x73	//notify xml structure err
#define DPS_ACTION_Err_Item	0x74	//request item name err

#define DPS_ACTION_START DPS_ACTION_ConfigurePrintService
#define DPS_ACTION_END	(DPS_ACTION_Response-1)

#define DPS_ACTION_ConfigurePrintService 0x10

#define DPS_ACTION_GetCapability 0x20
#define DPS_ACTION_GetCapability_Qualities	0x20
#define DPS_ACTION_GetCapability_PaperSizes	0x21
#define DPS_ACTION_GetCapability_PaperTypes	0x22 
#define DPS_ACTION_GetCapability_FileTypes	0x23
#define DPS_ACTION_GetCapability_DatePrints	0x24
#define DPS_ACTION_GetCapability_FileNamePrints	0x25
#define DPS_ACTION_GetCapability_ImageOptimizes	0x26
#define DPS_ACTION_GetCapability_Layouts	0x27
#define DPS_ACTION_GetCapability_FixedSizes	0x28
#define DPS_ACTION_GetCapability_Croppings	0x29

#define DPS_ACTION_StartJob 0x30
#define DPS_ACTION_AbortJob 0x3a
#define DPS_ACTION_ContinueJob 0x3b

#define DPS_ACTION_GetDeviceStatus 0x40
#define DPS_ACTION_GetJobStatus 0x41

#define DPS_ACTION_Response	0x50
#define DPS_ACTION_NotifyJobStatus		0x51
#define DPS_ACTION_NotifyDeviceStatus		0x52

#define dps_checkIsAction_GetCapability(action)	((action & DPS_ACTION_MASK)==DPS_ACTION_GetCapability)

//////////////////////////
//msg
#define dps_sendMsg(msg) osMsgPost(msg)
/////////////////////////////////////////
UINT8 dps_doAction(UINT8 action,UINT32 param);

UINT8 dps_addImageToPrint(UINT32 handle,UINT8 *pfileName,UINT16 copies,
	UINT16 cropping_x,UINT16 cropping_y,UINT16 cropping_w,UINT16 cropping_h,
	UINT8 *pDate
	);
UINT8 dps_clearPrtImageList();

UINT16 dps_getDataStatus(UINT8 type);
	
UINT16 dps_getPrtServiceInfo(PDPS_PARA_ConfigPrintService pcps);

UINT16 dps_getCapability(UINT8 type,PDPS_PARA_Capability_Elem pce);

UINT16 dps_getStatus(PDPS_PARA_JobStatus pjs,PDPS_PARA_DeviceStatus pds);

UINT8 dps_getPrtCapability(UINT8 type,UINT32 *pValue);

UINT8 dps_setPrtCapability(UINT8 type,UINT32 value);

UINT8 dps_getPrtConfigInfo(UINT8 index,PDPS_PARA_ConfigPrintInfo pcpi);

void dps_cmdTest(	UINT8 *param);

extern UINT32 sidc_makeHandle(UINT16 fileIndex);
extern UINT32 sidc_makeHandleFromOrd(UINT16 fileOrd);
extern void SIDC_Init();
extern void USBSIDC_BoSendEvent(
	UINT32 eventCode,
	UINT32 param0,
	UINT32 param1,
	UINT32 param2
) ;
extern void dps_init();
#define dps_sendEvent USBSIDC_BoSendEvent

typedef enum DPSParam_e 
{
	DPS_PARAM_SidcSurportImageCountMax=0,
	DPS_PARAM_MAX,
}DPSParam_t;
extern UINT32 dps_param[DPS_PARAM_MAX];

#define dps_paramGet(idx)	dps_param[idx]
#define dps_paramSet(idx,val)	dps_param[idx]=val
#endif
